import request from '@/utils/request'


//上传文件
export async function fileupload(query) {
  let config = {
    //添加请求头
    headers: { "Content-Type": "multipart/form-data" },
    timeout: 1000000,
  }
  return await request.post('/system/dirtree/uploadfile',query,config)
}
// 查询目录树列表
export function listDirtree(query) {
  return request({
    url: '/system/dirtree/list',
    method: 'get',
    params: query
  })
}

// 查询目录树详细
export function getDirtree(DirtreeId) {
  return request({
    url: '/system/dirtree/' + DirtreeId,
    method: 'get'
  })
}

// 查询目录树下拉树结构
export function treeselect() {
  return request({
    url: '/system/dirtree/treeselect',
    method: 'get'
  })
}


// 新增目录树
export function addDirtree(data) {
  return request({
    url: '/system/dirtree',
    method: 'post',
    data: data
  })
}

// 修改目录树
export function updateDirtree(data) {
  return request({
    url: '/system/dirtree',
    method: 'put',
    data: data
  })
}

// 删除目录树
export function delDirtree(DirtreeId) {
  return request({
    url: '/system/dirtree/' + DirtreeId,
    method: 'delete'
  })
}


